<?php

namespace paymch\controllers;

use Yii;
use paymch\components\BaseController as Controller;
use paymch\models\AbnormalRefund;

/**
 * RefundController
 */
class RefundController extends Controller {

    /**
     * actionAbnormal
     * @return json
     */
    public function actionAbnormal() {
        $status = false;
        $data = Yii::$app->request->post();
        //记录日志-保存通知参数
        parent::log('AbnormalRefund', [
            'postData' => $data
        ]);

        $model = new AbnormalRefund();
        $msg = 'Success';
        if ($model->load($data, '')) {
            $status = $model->save($msg);
        } else {
            $msg = '请求数据失败！';
        }
        Yii::$app->response->format = \yii\web\Response::FORMAT_JSON;
        return compact('status', 'msg');
    }

}
